//  Copyright (c) Microsoft Corporation.  All Rights Reserved.

using System;
using System.Collections.Generic;
using System.Text;

using System.IdentityModel.Tokens;
using System.IdentityModel.Selectors;

namespace Saml20
{
    public class EncryptionParameters
    {
        string encryptionAlgorithm;
        int encryptionKeySize;
        SecurityToken wrappingToken;
        SecurityKeyIdentifier wrappingTokenIdentifier;
        string encryptedKeyAlgorithm;

        public EncryptionParameters(string encryptionAlgorithm, int encryptionKeySize, SecurityToken wrappingToken, SecurityKeyIdentifier wrappingTokenIdentifier, string encryptedKeyAlgorithm)
        {
            if (String.IsNullOrEmpty(encryptionAlgorithm))
                throw new ArgumentException("encryptionAlgorithm");

            if (encryptionKeySize < 32)
                throw new ArgumentException("Invalid Key Size.");

            if (wrappingToken == null)
                throw new ArgumentNullException("wrappingToken");

            if (wrappingTokenIdentifier == null)
                throw new ArgumentNullException("wrappingTokenIdentifier");

            if (String.IsNullOrEmpty(encryptedKeyAlgorithm))
                throw new ArgumentException("encryptedKeyAlgorithm");

            this.encryptionAlgorithm = encryptionAlgorithm;
            this.encryptionKeySize = encryptionKeySize;
            this.wrappingToken = wrappingToken;
            this.wrappingTokenIdentifier = wrappingTokenIdentifier;
            this.encryptedKeyAlgorithm = encryptedKeyAlgorithm;
        }

        public string EncryptionAlgorithm
        {
            get { return this.encryptionAlgorithm; }
        }

        public int EncryptionKeySize
        {
            get { return this.encryptionKeySize; }
        }

        public SecurityToken WrappingToken
        {
            get { return this.wrappingToken; }
        }

        public SecurityKeyIdentifier WrappingTokenIdentifier
        {
            get { return this.wrappingTokenIdentifier; }
        }

        public string EncryptedKeyAlgorithm
        {
            get { return this.encryptedKeyAlgorithm; }
        }
    }
}
